﻿@model IEnumerable<VideoCache.Server.Model.DictionaryInfo>
@{
    ViewBag.Title = "字典管理";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@section css
{
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/content/themes/default/easyui.css")">
	<link rel="stylesheet" type="text/css" href="@Url.Content("~/content/themes/icon.css")">
}
@section script
{
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.easyui.min.js")"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#grid').treegrid({
                url: '@Url.Action("List", "Dictionary", new { area = "Admin" })',
                rownumbers: false,
                idField: 'Id',
                treeField: 'Name',
                columns: [[
                    { title: '编号', field: 'Id', width: 50, align: 'center' },
                    { title: '名称', field: 'Name', width: 450 },                    
                    { field: 'action', title: '操作选项', width: 150, align: 'center', formatter: function (value, row) {
                        var e = "<a href='#' class='edit' url='/Tree/Edit?id=" + row.id + "'>编辑</a> ";
                        var d = '<a href="#">删除</a>';

                        return e + d;
                    } 
                    }
                ]]
            });
        });
    </script>
}
<h2 class="pageTitle">@ViewBag.Title</h2>
<div class="easyui-panel wrap">
    <a href="@Url.Action("Create")" class="easyui-linkbutton">新建</a>
</div>
<div class="formContent">
@using (Html.BeginForm())
{
    <div class="easyui-panel wrap">
        <label>编号：<input type="text" name="Id" id="Id" readonly="readonly" /></label>
        <label>名称： <input type="text" name="Name" id="Name" /></label>
        <label>上级分类：
        <input class="easyui-combotree" data-options="url:'@Url.Action("ListTree", "Dictionary", new { area ="Admin"})',required:true" style="width:200px;" value="0">
        </label>
        <button type="submit">保存</button>
    </div>
}
</div>
<table id="grid" class="easyui-treegrid" width="100%">

</table>